package com.ymf.controller;

import com.ymf.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class UploadController {

    @Autowired
    private FileService fileService;

    //头像上传
    @CrossOrigin(origins = "*")
    @PostMapping("uploadavatar")
    public String uploadAvatar(@RequestBody MultipartFile file){
        return fileService.uploadAvatar(file);
    }
}
